package band.wukong.practice.javase.core.io.file;

import java.io.File;
import java.io.FileFilter;

/**
 * Desc:
 * Author: sunjs
 * Date: 2009-11-12 15:45:24
 */
public class TestFileFilter {

    static class JavaFileFilter implements FileFilter {
        public boolean accept(File path) {
            String name = path.getName();
            return name.indexOf(".java") != -1;
        }
    }

    public static void main(String[] args) throws Exception {
        final String PATH = "E:\\workspace\\TestJava\\src\\com\\jsun\\javase\\io\\doc";
        File file = new File(PATH);
        FileFilter fileFilter = new JavaFileFilter();
        File[] files = file.listFiles(fileFilter);

        for (File file1 : files) {
            System.out.println(file1.getAbsolutePath());
        }
    }

}
